package ari.com.eft.epp.namespace;

import java.util.ArrayList;
import java.util.List;

/**
 * All namespaces supported by the server and will be used to validate the
 * namespace supplied in each operation.
 */
public enum EPPSupportedExtensions {

	/** The IDNA domain name-space URI. */
	IDNA("IDNA", "urn:X-ar:params:xml:ns:idnadomain-1.0"),

	/** The KV domain name-space URI. */
	KV("KV", "urn:X-ar:params:xml:ns:kv-1.0"),

	/** The registrant name-space URI. */
	REGISTRANT("REGISTRANT", "urn:X-ar:params:xml:ns:registrant-1.0"),

	/** The registry grace period processing URI. */
	REGISTRY_GRACE_PERIOD("RGP", "urn:ietf:params:xml:ns:rgp-1.0"),

	/** The SEC DNS name-space URI. */
	SEC_DNS("SEC DNS", "urn:ietf:params:xml:ns:secDNS-1.1"),

	/** The SYNC name-space URI. */
	SYNC("SYNC", "urn:X-ar:params:xml:ns:sync-1.0"),

	/** The variant name-space URI. */
	VARIANT("VARIANT", "urn:X-ar:params:xml:ns:variant-1.0"),

	/** The VI EXT name-space URI. */
	VI("VI", "urn:X-ar:params:xml:ns:viext-1.0");

	private final String uri;
	private final String extName;

	private EPPSupportedExtensions(final String extName, final String uri) {
		this.uri = uri;
		this.extName = extName;
	}

	/**
	 * Gets the real namespace URI for the enum type.
	 * 
	 * @return the URI
	 */
	public String getURI() {
		return uri;
	}

	public String getName() {
		return extName;
	}

	public static List<String> getList() {
		final List<String> extensions = new ArrayList<String>();
		for (final EPPSupportedExtensions extension : EPPSupportedExtensions
				.values()) {
			extensions.add(extension.getName());
		}
		return extensions;
	}
}